<template>
	<div>
		<chat-header></chat-header>
		<chat-bottom @msgData="msgDatas"></chat-bottom>
	</div>
</template>

<script type="text/javascript">
import chatHeader from './components/chatHeader'
import chatBottom from './components/chatBottom'

	export default {
		name:"chatRoom",
		data(){
			return{
				msg_data:"",
			}
		},
		components:{
			chatHeader,
			chatBottom,
		},
		methods:{
			msgDatas(msg){//响应子组件传给父组件的函数(与项目无关，之前弄的)
				this.msg_data=msg;
			},
			getData () {//在static中的mock目录，调试用的数据
				//在config的index.js文件中,修改
				this.$a.get('/api/index.json')
				.then(this.GetDataInfoSucc,err=>{
					console.log('shibai')
		})
	},
			GetDataInfoSucc (res) {
				res = res.data

				if (res.ret &&res.data) {

				const data = res.data
				this.names=data
				this.homes = data.home
			}
			}
		},
		mounted() {
    	this.getData();
    }
	}
</script>